class Prime
    attr_accessor:number
	def initialize(number)
		@number = number
	end
	def is_prime
		is_prime = true
		if @number > 2 
			2.upto(@number-1) {|i| is_prime = false if @number%i==0}
		end
		if @number < 2 
			puts "必须为大于1的自然数"
		else 
			puts @number.to_s + (is_prime ? "是素数" : "不是素数")
		end
	end
end

Prime.new(154).is_prime